<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%=@page_title || @test.name + "测试报告"%></title>
<link href="/stylesheets/survey_public.css" rel="stylesheet" type="text/css" />
<!--[if IE]><script language="javascript" type="text/javascript" src="/javascripts/jquery/excanvas.min.js"></script><![endif]-->
<script language="javascript" type="text/javascript" src="/javascripts/jquery/jquery-1.3.2.min.js"></script>
<script language="javascript" type="text/javascript" src="/javascripts/jquery/jquery.flot.min.js"></script>
<script language="javascript"> 
    function printsetup()  {
            web.execwb(8,1); // 打印页面设置
    }
    function printpreview()  {
            web.execwb(7,1); //打印页面预览
    }
    function copyToClipBoard()  {
            var clipBoardContent="";
            clipBoardContent+=document.title;
            clipBoardContent+="\n";
            clipBoardContent+=this.location.href;
            window.clipboardData.setData("Text",clipBoardContent);
            alert("复制成功，粘贴即可！");
    }
</script>

<style>
#content{ width:885px; float:left; height:800px}
.content01{ width:885px; float:left; height:42px; border-bottom:1px solid #1a80d0;}
.content01 ul{ width:748px; float:left; padding-left:80px;}
.content01 ul li{ width:69px; float:left; border-right:1px dashed #1a80d0; height:42px; line-height:42px; text-align:center; color:#000000;}
.content01 ul li.bb{ width:49px;}
.content01 ul li.bb02{ width:39px;}
.content01 ul li.bb03{ width:105px;}
.content01 ul li.bb04{ width:180px; border-right:none;}

.content02{ width:715px; float:left; padding:36px 0 0 80px;}
#tj{ width:500px; height:44px; float:left;}
#tj li{ width:107px; height:44px; float:left;}
#tj li.jj{ width:200px; height:30px; float:left; border:1px solid rgb(218, 218, 218); text-align:center; line-height:30px; color:#000000; margin-top:12px;}

#df{ width:450px; float:left; margin:15px  0 ;}
#df li{ width:131px; float:left;}
#df li.ff{ width:209px; float:left; margin-top:15px;}

#dimen{ width:450px; float:left; margin-top:15px;}
#dimen li{ width:131px; float:left; }
#dimen li.ff{ width:209px;  float:left; margin:15px  0 ;}

#dimen_ex{ width:450px; float:left; margin-top:15px;}
#dimen_ex li{ width:131px; float:left; }
#dimen_ex li.right{ width:209px;  float:left; margin:15px  0 ;}

.bian{ width:209px; height:1px; background:#dadada;}
#bg{ width:610px; float:left; margin:15px  0 ;}
#bg li{ width:72px; float:left;}

.back{ width:102px; height:35px; float:left; padding-right:20px; margin-left:600px; margin-top:20px;}
#footer{ width:100%; height:200px; float:left; background:url(/images/user/report/footer.jpg) no-repeat; text-align:center; color:#295c72;}
#footer h1{ margin-top:100px;}

table tr td{padding:2px 10px 2px 10px; }

.report-item{float:left; width:700px; margin:10px 80px 10px 50px}
.report-item h1{font-size: 18px;}
</style>
</head>

<body>

  <div id="page">

    <div id="header">
		<ol>
                  <li id="title-text"><%= @test_record.survey.name %></li>
		</ol>
		<ul>
                  <li id="org-text">
                  <%=current_user.name%>
                </li>
                  <li><a href="/login/logout">安全退出</a></li>
		</ul>
    </div>

    <div id="content">

      <div class="content01">
            <ul>
            <li>姓名</li>
            <li><%=@test_record.username%></li>
            <li>性别</li>
            <li class="bb"><%=@test_record.gender%></li>
            <li>年龄</li>
            <li class="bb02"><%=@test_record.age%></li>
            <li class="bb03">测量日期</li>
            <li class="bb04"><%=@test_record.created_at.strftime('%Y年 %m月%d日')%></li>
            </ul>
      </div>

      <div class="report-item">
        <h1>测试结果</h1>
        <table>
          <tr>
            <td>因子</td>
            <td>L</td>
            <td>F</td>
            <td>K</td>
            <td>Hs</td>
            <td>D</td>
            <td>Hy</td>
            <td>Pd</td>
            <td>Mf</td>
            <td>Pa</td>
            <td>Pt</td>
            <td>Sc</td>
            <td>Ma</td>
            <td>Si</td>
          </tr>
          <tr>
            <td>T分</td>
            <td><%= sprintf("%8.0f", @report[:dimen_results]["L"]) %></td>
            <td><%= sprintf("%8.0f", @report[:dimen_results]["F"]) %></td>
            <td><%= sprintf("%8.0f", @report[:dimen_results]["K"]) %></td>
            <td><%= sprintf("%8.0f", @report[:dimen_results]["Hs"]) %></td>
            <td><%= sprintf("%8.0f", @report[:dimen_results]["D"]) %></td>
            <td><%= sprintf("%8.0f", @report[:dimen_results]["Hy"]) %></td>
            <td><%= sprintf("%8.0f", @report[:dimen_results]["Pd"]) %></td>
            <td><%= sprintf("%8.0f", @report[:dimen_results]["Mf"]) %></td>
            <td><%= sprintf("%8.0f", @report[:dimen_results]["Pa"]) %></td>
            <td><%= sprintf("%8.0f", @report[:dimen_results]["Pt"]) %></td>
            <td><%= sprintf("%8.0f", @report[:dimen_results]["Sc"]) %></td>
            <td><%= sprintf("%8.0f", @report[:dimen_results]["Ma"]) %></td>
            <td><%= sprintf("%8.0f", @report[:dimen_results]["Si"]) %></td>
          </tr>
        </table>
      </div>
      
      <div class="report-item">
        <h1>人格剖面图</h1>
        <div id="chart0" style="height:300px;width:450px;">chart</div>
      </div>

      <div class="report-item">
        <h1>编码分析</h1>
        <% if @report[:code][:name] %>
          <%= @report[:code][:name] %><br/>
          <%= @report[:code][:expl] %>
        <% else %>
          <%= @report[:code] %>
        <% end %>
      </div>
      
      <div class="back">
        <% if controller_name == "prof_surveys" %>
        <a href="/surveys/prof_surveys"><img src="/images/back.png" width="88" height="27" style="margin-left:10px;"/></a>
        <% else %>
        <a href="/user/reports"><img src="/images/back.png" width="88" height="27" style="margin-left:10px;"/></a>
        <% end %>
      </div>
    </div>
  </div>

  <div id="footer">

    <h1>北京心嘉源咨询有限公司 CopyRight © www.iyaoi.cn 2009</h1>

  </div>

  <script>
    $(function () {


      function showChart(series) {
        var data = series;
        var options = {
          lines: {show: true },
          points: {show: true },
          xaxis: {
            tickDecimals: 0,
            tickSize: 1 ,
            ticks: [[0,""],  [1, "L"], [2, "F"], [3, "K"], [4, ""],
               [5, "Hs"], [6, "D"], [7, "Hy"], [8, "Pd"], [9, "Mf"], [10, "Pa"],
               [11, "Pt"], [12, "Sc"], [13, "Ma"], [14, "Si"],[15, ""]]
          },
          yaxis:{
            ticks: [0, [50, "50"],[60, "60"], [70, "70"], [120, "120"]]
          }
        };
        //绘制图表
        $.plot($("#chart0"), data, options);
      }

      //$.ajax({
        //  url: "/data-eu-gdp-growth.json",
          //method: 'GET',
          //dataType: 'json',
          ///success: showChart
      //});

      showChart(<%=@t_json%>);

    });
  </script>
</body>
</html>
